﻿<%@ Page 
    Language="C#" 
    AutoEventWireup="true" 
    CodeBehind="RegistrarVentas.aspx.cs" 
    Inherits="HieloCostalegre.RegistrarVentas" 
    Trace="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Hielo Costalegre</title>
    <link href="~/Site.css" rel="stylesheet" type="text/css" />
</head>
<body class="template">
    <h1><span class="allcaps">Hielo Costalegre</span></h1>
    <div class="back">
        <a id="A1" runat="server" href="~/">
            <img id="Img1" alt="Página Principal" runat="server" src="DynamicData/Content/Images/back.gif" />
            Página Principal
        </a>
    </div>
    
    <h2>Registrar Ventas</h2>

    <form id="SalesForm" runat="server">
    <div>
    
        <p>
            <asp:DropDownList ID="ddlRoutes" runat="server" 
                DataValueField="Id" DataTextField="Name" 
                AutoPostBack='true'
                OnSelectedIndexChanged="RouteChanged" />
                
            <asp:Calendar ID="Calendar" runat="server" 
                onselectionchanged="DateChanged" />
        </p>
        
        <p>
        
            <table border="0">
                <tr>
                    <th>Cliente</th>
                    <% foreach(HieloCostalegre.Product product in Products) { %>
                        <th><%=product.Name%></th>
                    <%} %>
                </tr>
                
                <% foreach (HieloCostalegre.Business business in Businesses){ %>
                    <tr>
                        <td><%=business.Name%></td>
                        
                        <% foreach(HieloCostalegre.Product product in Products) { %>
                            <td><input type='text' name='<%=GetSaleId(business.Id, product.Id)%>' value='<%=GetSaleQuantity(business.Id, product.Id)%>' /></td>
                        <%} %>
                        
                    </tr>
                <%} %>
            </table>               
            
        </p>
        
        <p>
            <asp:Button ID="btnRegisterSales" runat="server" Text="Registrar Ventas" OnClick="RegisterSales" />
        </p>
        
    </div>
    </form>
</body>
</html>
